/* ==========================================================================
   Update Modal Styles
   ========================================================================== */

.update-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fadeIn 0.2s ease-out; /* Fade in animation */
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  backdrop-filter: blur(2px); /* Slight blur effect for depth */
  transition: opacity 0.2s ease; /* Smooth transition when closing */
}

.update-modal-content {
  background-color: var(--background-primary);
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  border: var(--standard-border);
  width: 95%;
  max-width: 450px;
  padding: 0;
  outline: none;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.25s ease-out;
  will-change: transform, opacity;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  -ms-border-radius: 8px;
  -o-border-radius: 8px;
}

.update-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--standard-border);
  background: none;
  position: relative;
  min-height: 48px;
}

.update-modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  line-height: 1.2;
}

.update-modal-close-button {
  padding: 4px 12px;
  color: var(--text-primary);
  border: solid 1px var(--border-color);
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  line-height: 1;
  text-align: center;
  border-radius: 4px;
}

.update-modal-close-button:hover,
.update-modal-close-button:focus-visible {
  border-color: var(--color-primary);
  background-color: var(--hover-color);
  color: var(--text-primary);
}

.update-error {
  color: var(--error-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  min-height: 24px;
  margin: 8px 0;
  padding: 0 18px;
  text-align: center;
}

/* UpdateModal message and button spacing */
.update-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.update-modal-body .update-message {
  font-size: var(--font-size-md);
  padding: 2px 18px;
  text-align: center;
  align-items: center;
  min-height: 40px;
}

.update-modal-body .update-message-success {
  color: var(--color-primary);
  font-weight: 600;
  text-align: center;
  margin-top: 14px;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.update-modal-body .check-updates-button {
  margin-top: 8px;
  margin-bottom: 20px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-left: auto;
  margin-right: auto;
}

.check-updates-button {
  background-color: var(--hover-color);
  color: var(--text-primary);
  border-color: var(--border-color);
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1px;
}

.check-updates-button:hover {
  background-color: var(--hover-color);
  border-color: var(--color-primary);
  color: var(--text-primary);
  transition:
    all 0.2s var(--animation-curve),
    background-color 0.3s ease;
}

/* Ensure consistent vertical spacing in update modal */
.update-modal-body > * {
  margin-bottom: 14px;
}

.dark-mode,
.update-modal-overlay,
.update-modal-header,
.update-modal-content,
.update-modal-body {
  border-color: var(--border-color);
}

.dark-mode .check-updates-button:hover {
  border-color: var(--color-primary);
  background-color: var(--hover-color);
  color: var(--text-primary);
  transition:
    all 0.2s var(--animation-curve),
    background-color 0.3s ease;
}

/* Styles for the Check for Updates button in the main app header */
.header-action-btn.check-updates-button {
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Highlighted state when update is available */
.header-action-btn.check-updates-button.update-available {
  background-color: var(--color-primary);
  color: var(--text-on-primary);
}
